package service;

import DAO.EmpDao;
import DAO.EmpDaoImpl;
import entity.Emp;
import utils.Dbutils;

import java.util.List;

/**
 * @author lishunlin110
 * @version 1.0
 * @description: 员工业务层实现
 * @date 2021/8/26 22:02
 */
public class EmpServiceImpl implements EmpService{
    @Override
    public List<Emp> showAll() {
        EmpDao empDao = new EmpDaoImpl();
        List<Emp> empList = null;
        try {
            Dbutils.begin();
            empList = empDao.queryAll();
            Dbutils.commit();
        } catch (Exception e) {
            Dbutils.rollback();
            e.printStackTrace();
        }
        return empList;
    }
}
